//
//  h
/*
 *  SSNeedsDiamond.
 *  MESLib
 * 
 * Copyright 2003-2009 Starline Software Ltd
 * 
 * This file is part of MESLib.
 * 
 * MESLib is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * MESLib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with MESLib. If not, see <http://www.gnu.org/licenses/>.
 */
//  Created by Tobias Haughton on Wed Mar 19 2003.
//  Copyright (c) 2003 Starline Software. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "SSConst.h"
#import "SSDiamondOption.h"

@interface SSNeedsDiamond : NSObject {
   id owner; //Event or link object which we are attached to
   NSNumber *number;
   NSString *fileID;
   NSString *analyst;
   NSNumber *diamondState;
   NSString *description;
   NSMutableArray *optionArray;
   NSString *udValue1;
   NSString *udValue2;
   NSString *udValue3;
   NSString *udValue4;
   NSString *udValue5;
   NSString *udValue6;
   BOOL isSelected;
   BOOL isLoading;
}

- (id)init;
- (id)initWithOwner:(id)own;
- (id)initWithOwner:(id)own number:(NSNumber *)num;
- (id)initWithOwner:(id)own fileID:(NSString *)file analyst:(NSString *)an description:(NSString *)des optionArray:(NSMutableArray *)problems  diamondState:(NSNumber *)state;
- (id)initWithOwner:(id)own
             fileID:(NSString *)file
            analyst:(NSString *)an
        description:(NSString *)des
           udValue1:(NSString *)ud1
           udValue2:(NSString *)ud2
           udValue3:(NSString *)ud3
           udValue4:(NSString *)ud4
           udValue5:(NSString *)ud5
           udValue6:(NSString *)ud6
        optionArray:(NSMutableArray *)options
       diamondState:(NSNumber *)state;

- (id)owner;
- (NSNumber *)number;
- (NSString *)fileID;
- (NSString *)analyst;
- (NSString *)description;
- (NSNumber *)diamondState;
- (NSString *)ownerType;
- (NSString *)ownerDescription;
- (NSMutableArray *)optionArray;
- (NSString *)udValue1;
- (NSString *)udValue2;
- (NSString *)udValue3;
- (NSString *)udValue4;
- (NSString *)udValue5;
- (NSString *)udValue6;
- (NSString *)searchString;

- (void)setOwner:(id)own;
- (void)setNumber:(NSNumber *)num;
- (void)setFileID:(NSString *)string;
- (void)setAnalyst:(NSString *)string;
- (void)setDescription:(NSString *)string;
- (void)setDiamondState:(NSNumber *)num;
- (void)switchDiamondState;
- (void)setOptionArray:(NSMutableArray *)array;
- (void)setUdValue1:(NSString *)string;
- (void)setUdValue2:(NSString *)string;
- (void)setUdValue3:(NSString *)string;
- (void)setUdValue4:(NSString *)string;
- (void)setUdValue5:(NSString *)string;
- (void)setUdValue6:(NSString *)string;

- (void)addOption:(SSDiamondOption *)problem;
- (void)addNewOption;
- (void)removeOption:(SSDiamondOption *)problem;

- (NSString *)ownerDescriptionForCSV;
- (NSString *)diamondStateString;

- (BOOL)isFullyWithinRect:(NSRect)rect;
- (BOOL)containsPoint:(NSPoint)point;
- (NSRect)frame;
- (NSPoint)origin;

- (BOOL)isSelected;
- (void)setSelected;
- (void)setUnselected;

- (void)draw;

- (NSString *)xmlStringRepresentation;
- (NSString *)optionsXMLString;

@end
